package com.youdianda.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youdianda.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository()
public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     * 管理员总数
     * @return
     */
    @Select("select count(*) from sys_user")
    Integer getNumber();

    /**
     * 根据id获取用户信息
     * @param sysUserId
     * @return
     */
    SysUser getById(@Param("sysUserId") Long sysUserId);

    /**
     * 管理端登录用户
     * @param loginName
     * @return
     */
    @Select("select * from sys_user where login_name=#{loginName}")
    SysUser login(String loginName);
}
